<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/commons/pages/taglibs.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>DTU状态</title>
<link rel="stylesheet" type="text/css" href="../jquery-easyui/themes/${themes}/easyui.css">
<link rel="stylesheet" type="text/css" href="../jquery-easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../styles/demo.css">
<script type="text/javascript" src="../jquery-easyui/jquery.min.js"></script>
<script type="text/javascript" src="../jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../scripts/public.js.jsp"></script>
<script type="text/javascript" src="${ctx}/platform/type-info/format"></script>
</head>
<body>
<!--div class="demo-info">
  <div class="demo-tip icon-tip"></div>
  <div>DTU状态</div>
</div-->
<c:if test="${true}">
  <div style="padding:5px; margin-bottom:5px; display:block;" class="combo">
    <form method="post" id="fm_search" novalidate style="display:inline-block">
      DTU ID：
        <select id="modem_id" name="modem_id" style="width:80px;">
      </select>
      手机号:
      <input type="text" id="phone_no" name="phone_no" size="11" maxlength="11" />
      <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="doSearch();">搜索</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'" onclick="$('#fm_search').form('clear');">重置</a>
    </form>
    <c:import url="__refresh.jsp" />
  </div>
</c:if>
<div id="dg"> </div>
<script type="text/javascript">
$(function(){
	//初始化列表
	$('#dg').datagrid({  
	    url:'${ctx}/platform/dtu-info/search',
		queryParams:$('#fm_search').serializeObject(),
	    frozenColumns:[[
	    	{field:'ck',checkbox:true}
	 	]],
	    columns:[[
			//{field:'id',title:'id',hidden:true},   
			{/*width:140,*/ field:'conn_time',	title:'最后建立连接时间',formatter:formatDateTime},
			{/*width:80, */ field:'modem_id',	title:'DTU ID',sortable:true},
			{/*width:120,*/ field:'phone_no',	title:'手机号'},
			{/*width:120,*/ field:'dyn_ip',		title:'动态IP地址'},
			{/*width:140,*/ field:'refresh_time',title:'最后收发数据时间',formatter:formatDateTime},
			{/*width:40, */ field:'id',title:'在线',formatter:function (value, row) {
					if (new Date().getTime() - row.refresh_time < 60000) {
						return '<span style="color:green;">在线</span>';
					} 
					return '<span style="color:red;">离线</span>';
				}}
	    ]],
		//fitColumns:true,
		striped:true,
		pagination:true,
		remoteSort:false,
		rownumbers:true,
		singleSelect:false,
		autoSizeColumn:true,
		toolbar:[
			//<c:if test="${true}">
			{
				id:'btnRemove',
				text:'删除',
				iconCls:'icon-remove',
				handler:function(){doRemove();}
			},'-',
			//</c:if>
			//<c:if test="${false}">
			{
				id:'btnAdd',
				text:'添加',
				iconCls:'icon-add',
				handler:function(){doAdd();}
			},
			//</c:if>
			//<c:if test="${false}">
			{
				id:'btnEdit',
				text:'修改',
				iconCls:'icon-edit',
				handler:function(){doEdit();}
			},
			//</c:if>{}
		] 
	}); 
}); 
</script>
</body>
</html>